{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2018年中国大学毕业生薪酬排行榜"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-25T08:41:51.470384Z",
     "start_time": "2019-02-25T08:41:51.457383Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\n2018年中国大学毕业生薪酬排行榜\\n\\nhttps://pyecharts.github.io/pyecharts.js-app/#https://raw.githubusercontent.com/pyecharts/pyecharts-app/master/app/charts/map.py\\nhttps://nbviewer.jupyter.org/github/pyecharts/pyecharts-users-cases/blob/master/notebook-users-cases/notebook-user-cases.ipynb\\n'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"\"\"\n",
    "2018年中国大学毕业生薪酬排行榜\n",
    "\n",
    "https://pyecharts.github.io/pyecharts.js-app/#https://raw.githubusercontent.com/pyecharts/pyecharts-app/master/app/charts/map.py\n",
    "https://nbviewer.jupyter.org/github/pyecharts/pyecharts-users-cases/blob/master/notebook-users-cases/notebook-user-cases.ipynb\n",
    "\"\"\"\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-25T08:41:52.077419Z",
     "start_time": "2019-02-25T08:41:51.472384Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-25T08:41:52.229427Z",
     "start_time": "2019-02-25T08:41:52.082419Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>rank</th>\n",
       "      <th>university</th>\n",
       "      <th>category</th>\n",
       "      <th>province</th>\n",
       "      <th>985</th>\n",
       "      <th>211</th>\n",
       "      <th>2017</th>\n",
       "      <th>2015</th>\n",
       "      <th>2013</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>清华大学</td>\n",
       "      <td>理工</td>\n",
       "      <td>北京</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>9065</td>\n",
       "      <td>10969</td>\n",
       "      <td>12614</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>北京大学</td>\n",
       "      <td>综合</td>\n",
       "      <td>北京</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>9042</td>\n",
       "      <td>11212</td>\n",
       "      <td>13790</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>北京外国语大学</td>\n",
       "      <td>语言</td>\n",
       "      <td>北京</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>9020</td>\n",
       "      <td>10464</td>\n",
       "      <td>12242</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>上海交通大学</td>\n",
       "      <td>综合</td>\n",
       "      <td>上海</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>9010</td>\n",
       "      <td>10542</td>\n",
       "      <td>12861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>对外经济贸易大学</td>\n",
       "      <td>财经</td>\n",
       "      <td>北京</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>8998</td>\n",
       "      <td>10617</td>\n",
       "      <td>12316</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>外交学院</td>\n",
       "      <td>语言</td>\n",
       "      <td>北京</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8956</td>\n",
       "      <td>11016</td>\n",
       "      <td>12669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>复旦大学</td>\n",
       "      <td>综合</td>\n",
       "      <td>上海</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>8842</td>\n",
       "      <td>11052</td>\n",
       "      <td>13594</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>浙江大学</td>\n",
       "      <td>综合</td>\n",
       "      <td>浙江</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>8810</td>\n",
       "      <td>10308</td>\n",
       "      <td>12369</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>同济大学</td>\n",
       "      <td>理工</td>\n",
       "      <td>上海</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>8784</td>\n",
       "      <td>10893</td>\n",
       "      <td>13616</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>中央财经大学</td>\n",
       "      <td>财经</td>\n",
       "      <td>北京</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>8771</td>\n",
       "      <td>10086</td>\n",
       "      <td>11902</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   rank university category province  985  211  2017   2015   2013\n",
       "0     1       清华大学       理工       北京    1    1  9065  10969  12614\n",
       "1     2       北京大学       综合       北京    1    1  9042  11212  13790\n",
       "2     3    北京外国语大学       语言       北京    0    1  9020  10464  12242\n",
       "3     4     上海交通大学       综合       上海    1    1  9010  10542  12861\n",
       "4     5   对外经济贸易大学       财经       北京    0    1  8998  10617  12316\n",
       "5     6       外交学院       语言       北京    0    0  8956  11016  12669\n",
       "6     7       复旦大学       综合       上海    1    1  8842  11052  13594\n",
       "7     8       浙江大学       综合       浙江    1    1  8810  10308  12369\n",
       "8     9       同济大学       理工       上海    1    1  8784  10893  13616\n",
       "9    10     中央财经大学       财经       北京    0    1  8771  10086  11902"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 数据概览\n",
    "data = pd.read_csv('./salary.csv')\n",
    "data.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-25T08:41:52.311432Z",
     "start_time": "2019-02-25T08:41:52.235428Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 200 entries, 0 to 199\n",
      "Data columns (total 9 columns):\n",
      "rank          200 non-null int64\n",
      "university    200 non-null object\n",
      "category      200 non-null object\n",
      "province      200 non-null object\n",
      "985           200 non-null int64\n",
      "211           200 non-null int64\n",
      "2017          200 non-null int64\n",
      "2015          200 non-null int64\n",
      "2013          200 non-null int64\n",
      "dtypes: int64(6), object(3)\n",
      "memory usage: 14.1+ KB\n",
      "None\n",
      "              rank university category province         985         211  \\\n",
      "count   200.000000        200      200      200  200.000000  200.000000   \n",
      "unique         NaN        200       10       26         NaN         NaN   \n",
      "top            NaN     浙江理工大学       理工       北京         NaN         NaN   \n",
      "freq           NaN          1       77       45         NaN         NaN   \n",
      "mean    100.500000        NaN      NaN      NaN    0.165000    0.370000   \n",
      "std      57.879185        NaN      NaN      NaN    0.372112    0.484016   \n",
      "min       1.000000        NaN      NaN      NaN    0.000000    0.000000   \n",
      "25%      50.750000        NaN      NaN      NaN    0.000000    0.000000   \n",
      "50%     100.500000        NaN      NaN      NaN    0.000000    0.000000   \n",
      "75%     150.250000        NaN      NaN      NaN    0.000000    1.000000   \n",
      "max     200.000000        NaN      NaN      NaN    1.000000    1.000000   \n",
      "\n",
      "               2017          2015          2013  \n",
      "count    200.000000    200.000000    200.000000  \n",
      "unique          NaN           NaN           NaN  \n",
      "top             NaN           NaN           NaN  \n",
      "freq            NaN           NaN           NaN  \n",
      "mean    6188.560000   7405.880000   8847.960000  \n",
      "std     1733.915349   2072.037197   2465.600472  \n",
      "min     3394.000000   3971.000000   4734.000000  \n",
      "25%     4629.250000   5584.250000   6655.750000  \n",
      "50%     6165.500000   7424.500000   8816.500000  \n",
      "75%     7797.750000   9260.500000  11134.000000  \n",
      "max     9065.000000  11212.000000  13790.000000  \n"
     ]
    }
   ],
   "source": [
    "print(data.info())\n",
    "print(data.describe(include='all'))\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 高校薪资排名"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-25T08:41:52.346434Z",
     "start_time": "2019-02-25T08:41:52.315432Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>university</th>\n",
       "      <th>2017</th>\n",
       "      <th>university</th>\n",
       "      <th>2013</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>清华大学</td>\n",
       "      <td>9065</td>\n",
       "      <td>北京大学</td>\n",
       "      <td>13790</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>北京大学</td>\n",
       "      <td>9042</td>\n",
       "      <td>复旦大学</td>\n",
       "      <td>13594</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>北京外国语大学</td>\n",
       "      <td>9020</td>\n",
       "      <td>外交学院</td>\n",
       "      <td>12669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>上海交通大学</td>\n",
       "      <td>9010</td>\n",
       "      <td>清华大学</td>\n",
       "      <td>12614</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>对外经济贸易大学</td>\n",
       "      <td>8998</td>\n",
       "      <td>同济大学</td>\n",
       "      <td>13616</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>外交学院</td>\n",
       "      <td>8956</td>\n",
       "      <td>国际关系学院</td>\n",
       "      <td>12786</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>复旦大学</td>\n",
       "      <td>8842</td>\n",
       "      <td>上海外国语大学</td>\n",
       "      <td>12587</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>浙江大学</td>\n",
       "      <td>8810</td>\n",
       "      <td>中国人民大学</td>\n",
       "      <td>12258</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>同济大学</td>\n",
       "      <td>8784</td>\n",
       "      <td>对外经济贸易大学</td>\n",
       "      <td>12316</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>中央财经大学</td>\n",
       "      <td>8771</td>\n",
       "      <td>广东外语外贸大学</td>\n",
       "      <td>12229</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  university  2017 university   2013\n",
       "0       清华大学  9065       北京大学  13790\n",
       "1       北京大学  9042       复旦大学  13594\n",
       "2    北京外国语大学  9020       外交学院  12669\n",
       "3     上海交通大学  9010       清华大学  12614\n",
       "4   对外经济贸易大学  8998       同济大学  13616\n",
       "5       外交学院  8956     国际关系学院  12786\n",
       "6       复旦大学  8842    上海外国语大学  12587\n",
       "7       浙江大学  8810     中国人民大学  12258\n",
       "8       同济大学  8784   对外经济贸易大学  12316\n",
       "9     中央财经大学  8771   广东外语外贸大学  12229"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 工作 1 年和 5 年的薪资排行 TOP 10 高校\n",
    "data1 = data.iloc[:,[1,6]]\n",
    "\n",
    "data2 = data.sort_values(by='2015',ascending=False).reset_index(drop=True)\n",
    "data2 = data2.iloc[:,[1,8]]\n",
    "\n",
    "data3 = pd.concat([data1,data2],axis=1)\n",
    "data3.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-25T08:41:52.373435Z",
     "start_time": "2019-02-25T08:41:52.355434Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>university</th>\n",
       "      <th>2017</th>\n",
       "      <th>university</th>\n",
       "      <th>2013</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>190</th>\n",
       "      <td>兰州理工大学</td>\n",
       "      <td>3616</td>\n",
       "      <td>兰州理工大学</td>\n",
       "      <td>5206</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>191</th>\n",
       "      <td>青岛科技大学</td>\n",
       "      <td>3584</td>\n",
       "      <td>延边大学</td>\n",
       "      <td>5072</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>192</th>\n",
       "      <td>天津师范大学</td>\n",
       "      <td>3574</td>\n",
       "      <td>重庆工商大学</td>\n",
       "      <td>5253</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>193</th>\n",
       "      <td>华北电力大学(保定）</td>\n",
       "      <td>3542</td>\n",
       "      <td>青岛科技大学</td>\n",
       "      <td>5032</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>194</th>\n",
       "      <td>山东中医药大学</td>\n",
       "      <td>3528</td>\n",
       "      <td>南京信息工程大学</td>\n",
       "      <td>4974</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>195</th>\n",
       "      <td>江苏科技大学</td>\n",
       "      <td>3513</td>\n",
       "      <td>山东中医药大学</td>\n",
       "      <td>4871</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>196</th>\n",
       "      <td>武汉工程大学</td>\n",
       "      <td>3460</td>\n",
       "      <td>江苏科技大学</td>\n",
       "      <td>4934</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>延边大学</td>\n",
       "      <td>3437</td>\n",
       "      <td>华北电力大学(保定）</td>\n",
       "      <td>4931</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>南京信息工程大学</td>\n",
       "      <td>3426</td>\n",
       "      <td>武汉工程大学</td>\n",
       "      <td>4734</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>199</th>\n",
       "      <td>西安建筑科技大学</td>\n",
       "      <td>3394</td>\n",
       "      <td>西安建筑科技大学</td>\n",
       "      <td>4925</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     university  2017  university  2013\n",
       "190      兰州理工大学  3616      兰州理工大学  5206\n",
       "191      青岛科技大学  3584        延边大学  5072\n",
       "192      天津师范大学  3574      重庆工商大学  5253\n",
       "193  华北电力大学(保定）  3542      青岛科技大学  5032\n",
       "194     山东中医药大学  3528    南京信息工程大学  4974\n",
       "195      江苏科技大学  3513     山东中医药大学  4871\n",
       "196      武汉工程大学  3460      江苏科技大学  4934\n",
       "197        延边大学  3437  华北电力大学(保定）  4931\n",
       "198    南京信息工程大学  3426      武汉工程大学  4734\n",
       "199    西安建筑科技大学  3394    西安建筑科技大学  4925"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 工作 1 年和 5 年的薪资排行 BOT 10 高校\n",
    "data3.tail(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-25T04:46:43.650463Z",
     "start_time": "2019-02-25T04:46:43.618461Z"
    }
   },
   "source": [
    "# 按区域分 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-25T08:41:53.134479Z",
     "start_time": "2019-02-25T08:41:52.378436Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\nhttps://www.jianshu.com/p/e0b2851672cd\\n'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Bar,Map,Geo\n",
    "from pyecharts import Grid,configure \n",
    "\n",
    "configure(global_theme='dark')\n",
    "\n",
    "\"\"\"\n",
    "https://www.jianshu.com/p/e0b2851672cd\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-25T08:41:53.209483Z",
     "start_time": "2019-02-25T08:41:53.136479Z"
    },
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "province\n",
      "上海     7988.476190\n",
      "北京     7401.688889\n",
      "广东     6983.166667\n",
      "黑龙江    6741.666667\n",
      "辽宁     6194.400000\n",
      "福建     5973.250000\n",
      "陕西     5885.142857\n",
      "浙江     5824.272727\n",
      "江苏     5568.833333\n",
      "广西     5523.500000\n",
      "江西     5486.000000\n",
      "天津     5454.666667\n",
      "湖南     5417.333333\n",
      "安徽     5307.200000\n",
      "湖北     5301.571429\n",
      "海南     5203.000000\n",
      "四川     5122.500000\n",
      "吉林     5057.500000\n",
      "山东     4917.100000\n",
      "重庆     4866.666667\n",
      "山西     4626.666667\n",
      "贵州     4580.000000\n",
      "河北     4439.000000\n",
      "内蒙古    4190.000000\n",
      "河南     4128.000000\n",
      "甘肃     3675.333333\n",
      "Name: 2017, dtype: float64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min', 'china': '/nbextensions/echarts-countries-js/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"793a38e7dc7a4aa2b96f158bfbf8bba0\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts', 'china'], function(echarts) {\n",
       "        \n",
       "var myChart_793a38e7dc7a4aa2b96f158bfbf8bba0 = echarts.init(document.getElementById('793a38e7dc7a4aa2b96f158bfbf8bba0'), 'dark', {renderer: 'canvas'});\n",
       "\n",
       "var option_793a38e7dc7a4aa2b96f158bfbf8bba0 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u5927\\u5b66\\u6bd5\\u4e1a\\u4e00\\u5e74\\u85aa\\u8d44\\u5206\\u5e03\",\n",
       "            \"subtext\": \"\\u4e0a\\u5317\\u5e7f\\u85aa\\u8d44\\u6700\\u9ad8,\\u5185\\u8499\\u6cb3\\u5357\\u7518\\u8083\\u57ab\\u5e95\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#fff\",\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 3344019,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"map\",\n",
       "            \"symbol\": \"circle\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"mapType\": \"china\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": 7988.476190476191\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5185\\u8499\\u53e4\",\n",
       "                    \"value\": 4190.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": 7401.688888888889\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5409\\u6797\",\n",
       "                    \"value\": 5057.5\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u56db\\u5ddd\",\n",
       "                    \"value\": 5122.5\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5929\\u6d25\",\n",
       "                    \"value\": 5454.666666666667\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b89\\u5fbd\",\n",
       "                    \"value\": 5307.2\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u4e1c\",\n",
       "                    \"value\": 4917.1\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u897f\",\n",
       "                    \"value\": 4626.666666666667\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": 6983.166666666667\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"value\": 5523.5\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": 5568.833333333333\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": 5486.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5317\",\n",
       "                    \"value\": 4439.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5357\",\n",
       "                    \"value\": 4128.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": 5824.272727272727\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d77\\u5357\",\n",
       "                    \"value\": 5203.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5317\",\n",
       "                    \"value\": 5301.571428571428\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": 5417.333333333333\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7518\\u8083\",\n",
       "                    \"value\": 3675.3333333333335\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u798f\\u5efa\",\n",
       "                    \"value\": 5973.25\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8d35\\u5dde\",\n",
       "                    \"value\": 4580.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8fbd\\u5b81\",\n",
       "                    \"value\": 6194.4\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5e86\",\n",
       "                    \"value\": 4866.666666666667\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9655\\u897f\",\n",
       "                    \"value\": 5885.142857142857\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ed1\\u9f99\\u6c5f\",\n",
       "                    \"value\": 6741.666666666667\n",
       "                }\n",
       "            ],\n",
       "            \"roam\": true,\n",
       "            \"showLegendSymbol\": true\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"color\": [],\n",
       "    \"visualMap\": {\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 3000,\n",
       "        \"max\": 8000,\n",
       "        \"text\": [\n",
       "            \"high\",\n",
       "            \"low\"\n",
       "        ],\n",
       "        \"textStyle\": {\n",
       "            \"color\": \"#fff\"\n",
       "        },\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"left\",\n",
       "        \"top\": \"bottom\",\n",
       "        \"showLabel\": true\n",
       "    }\n",
       "};\n",
       "myChart_793a38e7dc7a4aa2b96f158bfbf8bba0.setOption(option_793a38e7dc7a4aa2b96f158bfbf8bba0);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.map.Map at 0x1239c978>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 大学毕业一年薪资分布\n",
    "\n",
    "data4 = data.groupby(by='province').mean()\n",
    "# print(data4)\n",
    "print(data4.sort_values(by='2017',ascending=False)['2017'])\n",
    "\n",
    "value = list(data4['2017'].values)\n",
    "attr = list(data4.index)\n",
    "# print(value,attr)\n",
    "\n",
    "map = Map('大学毕业一年薪资分布','上北广薪资最高,内蒙河南甘肃垫底',title_color='#fff',\n",
    "         title_pos='center') #,width=1200,height=600\n",
    "\n",
    "map.add('',attr,value,\n",
    "    maptype='china',\n",
    "    is_random=True,effect_scale=5,\n",
    "    visual_range=[3000,8000],\n",
    "    visual_text_color='#fff',\n",
    "    is_visualmap=True\n",
    ")\n",
    "map.render('毕业一年薪资区域分布.png')\n",
    "map\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-25T08:41:53.255486Z",
     "start_time": "2019-02-25T08:41:53.214484Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "province\n",
      "上海     11473.238095\n",
      "北京     10505.333333\n",
      "广东     10058.333333\n",
      "黑龙江     9526.333333\n",
      "辽宁      8694.600000\n",
      "福建      8407.000000\n",
      "陕西      8349.285714\n",
      "浙江      8298.000000\n",
      "江苏      8013.111111\n",
      "海南      7936.000000\n",
      "天津      7851.750000\n",
      "湖南      7819.166667\n",
      "湖北      7784.000000\n",
      "广西      7721.500000\n",
      "安徽      7706.600000\n",
      "江西      7509.500000\n",
      "四川      7489.000000\n",
      "吉林      7384.000000\n",
      "重庆      7028.166667\n",
      "山东      6996.800000\n",
      "山西      6666.000000\n",
      "贵州      6376.000000\n",
      "河北      6203.666667\n",
      "河南      5887.000000\n",
      "内蒙古     5734.000000\n",
      "甘肃      5321.333333\n",
      "Name: 2013, dtype: float64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min', 'china': '/nbextensions/echarts-countries-js/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"811be4ef42614a58a968a7ccab553310\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts', 'china'], function(echarts) {\n",
       "        \n",
       "var myChart_811be4ef42614a58a968a7ccab553310 = echarts.init(document.getElementById('811be4ef42614a58a968a7ccab553310'), 'dark', {renderer: 'canvas'});\n",
       "\n",
       "var option_811be4ef42614a58a968a7ccab553310 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u5927\\u5b66\\u6bd5\\u4e1a\\u4e94\\u5e74\\u85aa\\u8d44\\u5206\\u5e03\",\n",
       "            \"subtext\": \"\\u4e0a\\u5317\\u5e7f\\u6700\\u9ad8,\\u6cb3\\u5357\\u5185\\u8499\\u7518\\u8083\\u57ab\\u5e95\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#fff\",\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 8765922,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"map\",\n",
       "            \"symbol\": \"circle\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"mapType\": \"china\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": 11473.238095238095\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5185\\u8499\\u53e4\",\n",
       "                    \"value\": 5734.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": 10505.333333333334\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5409\\u6797\",\n",
       "                    \"value\": 7384.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u56db\\u5ddd\",\n",
       "                    \"value\": 7489.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5929\\u6d25\",\n",
       "                    \"value\": 7851.75\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b89\\u5fbd\",\n",
       "                    \"value\": 7706.6\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u4e1c\",\n",
       "                    \"value\": 6996.8\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u897f\",\n",
       "                    \"value\": 6666.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": 10058.333333333334\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"value\": 7721.5\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": 8013.111111111111\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": 7509.5\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5317\",\n",
       "                    \"value\": 6203.666666666667\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5357\",\n",
       "                    \"value\": 5887.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": 8298.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d77\\u5357\",\n",
       "                    \"value\": 7936.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5317\",\n",
       "                    \"value\": 7784.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": 7819.166666666667\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7518\\u8083\",\n",
       "                    \"value\": 5321.333333333333\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u798f\\u5efa\",\n",
       "                    \"value\": 8407.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8d35\\u5dde\",\n",
       "                    \"value\": 6376.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8fbd\\u5b81\",\n",
       "                    \"value\": 8694.6\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5e86\",\n",
       "                    \"value\": 7028.166666666667\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9655\\u897f\",\n",
       "                    \"value\": 8349.285714285714\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ed1\\u9f99\\u6c5f\",\n",
       "                    \"value\": 9526.333333333334\n",
       "                }\n",
       "            ],\n",
       "            \"roam\": true,\n",
       "            \"showLegendSymbol\": true\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"color\": [],\n",
       "    \"visualMap\": {\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 5000,\n",
       "        \"max\": 12000,\n",
       "        \"text\": [\n",
       "            \"high\",\n",
       "            \"low\"\n",
       "        ],\n",
       "        \"textStyle\": {\n",
       "            \"color\": \"#fff\"\n",
       "        },\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"left\",\n",
       "        \"top\": \"bottom\",\n",
       "        \"showLabel\": true\n",
       "    }\n",
       "};\n",
       "myChart_811be4ef42614a58a968a7ccab553310.setOption(option_811be4ef42614a58a968a7ccab553310);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.map.Map at 0x1239c4a8>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 大学毕业 5 年薪资分布\n",
    "\n",
    "print(data4.sort_values(by='2013',ascending=False)['2013'])\n",
    "\n",
    "value = list(data4['2013'].values)\n",
    "attr = list(data4.index)\n",
    "# print(value,attr)\n",
    "\n",
    "map = Map('大学毕业五年薪资分布','上北广最高,河南内蒙甘肃垫底',title_color='#fff',\n",
    "         title_pos='center') #,width=1200,height=600\n",
    "\n",
    "map.add('',attr,value,\n",
    "    maptype='china',\n",
    "    is_random=True,effect_scale=5,\n",
    "    visual_range=[5000,12000],\n",
    "    visual_text_color='#fff',\n",
    "    is_visualmap=True\n",
    ")\n",
    "map.render('毕业五年薪资区域分布.png')\n",
    "map\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-25T08:41:53.321490Z",
     "start_time": "2019-02-25T08:41:53.260486Z"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[7333.0, 6869.0, 6850.0, 6512.0, 6442.0, 6279.0, 5161.0, 5067.0, 5034.0, 4692.0] ['语言', '艺术', '政法', '综合', '财经', '理工', '农林', '师范', '体肓', '医药']\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"cbdd8e5ee1ad42249761fe936777f193\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_cbdd8e5ee1ad42249761fe936777f193 = echarts.init(document.getElementById('cbdd8e5ee1ad42249761fe936777f193'), 'dark', {renderer: 'canvas'});\n",
       "\n",
       "var option_cbdd8e5ee1ad42249761fe936777f193 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u4e0d\\u540c\\u5b66\\u6821\\u7c7b\\u578b\\u85aa\\u8d44\\u5bf9\\u6bd4\",\n",
       "            \"subtext\": \"\\u8bed\\u8a00\\u7c7b\\u6700\\u9ad8\\uff0c\\u533b\\u836f\\u6700\\u4f4e\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#fff\",\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 5160647,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                7333.0,\n",
       "                6869.0,\n",
       "                6850.0,\n",
       "                6512.0,\n",
       "                6442.0,\n",
       "                6279.0,\n",
       "                5161.0,\n",
       "                5067.0,\n",
       "                5034.0,\n",
       "                4692.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 5160647\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u8bed\\u8a00\",\n",
       "                \"\\u827a\\u672f\",\n",
       "                \"\\u653f\\u6cd5\",\n",
       "                \"\\u7efc\\u5408\",\n",
       "                \"\\u8d22\\u7ecf\",\n",
       "                \"\\u7406\\u5de5\",\n",
       "                \"\\u519c\\u6797\",\n",
       "                \"\\u5e08\\u8303\",\n",
       "                \"\\u4f53\\u8093\",\n",
       "                \"\\u533b\\u836f\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": []\n",
       "};\n",
       "myChart_cbdd8e5ee1ad42249761fe936777f193.setOption(option_cbdd8e5ee1ad42249761fe936777f193);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.bar.Bar at 0x123d5438>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 大学毕业 5 年薪资分布\n",
    "data5 = data.groupby(by='category').mean()\n",
    "data5.sort_values(by='2017',ascending=False,inplace=True)\n",
    "# data5 = data5\n",
    "# print(data5.sort_values(by='2017',ascending=False)['2017'])\n",
    "\n",
    "value = list(data5['2017'].values.round(0))\n",
    "attr = list(data5.index)\n",
    "print(value,attr)\n",
    "\n",
    "bar = Bar('不同学校类型薪资对比','语言类最高，医药最低',title_color='#fff',\n",
    "         title_pos='center') #,width=1200,height=600\n",
    "\n",
    "bar.add('',attr,value,\n",
    "    is_label_show=True,\n",
    "#     label_pos='right',\n",
    "    y_axis_interval=0,\n",
    "    y_axis_roate=45,\n",
    "#     is_convert=True,\n",
    ")\n",
    "map.render('不同学校类型薪资对比.png')\n",
    "bar\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-25T08:39:15.249449Z",
     "start_time": "2019-02-25T08:39:15.180445Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[5576.0, 6689.0, 7905.0] ['双非', '211', '985']\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"38472508781b40b198783de661ca598e\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_38472508781b40b198783de661ca598e = echarts.init(document.getElementById('38472508781b40b198783de661ca598e'), 'dark', {renderer: 'canvas'});\n",
       "\n",
       "var option_38472508781b40b198783de661ca598e = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u4e0d\\u540c\\u5b66\\u6821\\u7c7b\\u578b\\u85aa\\u8d44\\u5bf9\\u6bd4\",\n",
       "            \"subtext\": \"985\\u9ad8\\u6821\\u9ad8\\u4e8e211\\u9ad8\\u4e8e\\u53cc\\u975e\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#fff\",\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 4076757,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                5576.0,\n",
       "                6689.0,\n",
       "                7905.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4076757\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                6691.0,\n",
       "                7954.0,\n",
       "                9455.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4076757\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                7984.0,\n",
       "                9514.0,\n",
       "                11318.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4076757\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\",\n",
       "                \"\",\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"right\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u53cc\\u975e\",\n",
       "                \"211\",\n",
       "                \"985\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": []\n",
       "};\n",
       "myChart_38472508781b40b198783de661ca598e.setOption(option_38472508781b40b198783de661ca598e);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.bar.Bar at 0x1471ab38>"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 985 211 对比\n",
    "\n",
    "data5 = data.groupby(by=['985','211']).mean().round(0)\n",
    "data5.iloc[:,1:5]\n",
    "\n",
    "value = list(data5['2017'].values.round(0))\n",
    "value2 = list(data5['2015'].values.round(0))\n",
    "value3 = list(data5['2013'].values.round(0))\n",
    "# attr = list(data5.index)\n",
    "attr = ['双非','211','985']\n",
    "print(value,attr)\n",
    "\n",
    "bar = Bar('不同学校类型薪资对比','985高校高于211高于双非',title_color='#fff',\n",
    "         title_pos='center') #,width=1200,height=600\n",
    "\n",
    "bar.add('',attr,value,\n",
    "    is_label_show=True,\n",
    "    y_axis_interval=0,\n",
    "    y_axis_roate=45,\n",
    "    is_legend_show=True,\n",
    ")\n",
    "\n",
    "\n",
    "bar.add('',attr,value2,\n",
    "    is_label_show=True,\n",
    "    y_axis_interval=0,\n",
    "    y_axis_roate=45,\n",
    "    is_legend_show=True,\n",
    "    legend_pos='right'\n",
    ")\n",
    "\n",
    "bar.add('',attr,value3,\n",
    "    is_label_show=True,\n",
    "    y_axis_interval=0,\n",
    "    y_axis_roate=45,\n",
    "    is_legend_show=True,\n",
    "    legend_pos='right'\n",
    ")\n",
    "bar\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
